#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include<assert.h>
int my_strncmp(const char* s1, const char* s2, int num)
{
	assert(s1 && s2);
	while (num--)
	{
		while (*s1 == *s2)
		{
			if (*s1 == '\0')
				return 0;
			s1++;
			s2++;
		}
		return *s1 - *s2;
	}
}

int main()
{
	int num = 3;
	char arr1[] = "abcdef";
	char arr2[] = "abed";
	int len = my_strncmp(arr1, arr2, num);
	printf("%d\n", len);
	return 0;
}
